#include "../sysdef.h"
//*************************************************
//Added by WangJS 2005.9.14
//*************************************************
void ByteSwap(u8* B1, u8* B2)
{
	u8 Temp;
	Temp=*B1;
	*B1=*B2;
	*B2=Temp;
}
//***************************************************
//Added by WangJS 2005.9.14
//***************************************************
void* CompareMin(void* C1, void* C2, u32 CompSize)
{
	void* Equal=0;
	u8* S1=(u8*)C1;
	u8* S2=(u8*)C2;
	u32 i;

	for( i=0; i<CompSize; i++ )
	{
		Equal= ( S1[i] != S2[i] ) ? ( S1[i] < S2[i] ? (void*)S1 : (void*)S2 ) : 0;

		if(Equal)
		  return Equal;
	}

	if( !Equal )
		return C1;
	else
		return Equal;
}

void* CompareMax(void* C1, void* C2, u32 CompSize)
{
	void* Equal=0;
	u8* S1=(u8*)C1;
	u8* S2=(u8*)C2;
	u32 i;

	for( i=0; i<CompSize; i++ )
	{
		Equal= ( S1[i] != S2[i] ) ? ( S1[i] > S2[i] ? (void*)S1 : (void*)S2 ) : 0;

		if(Equal)
		  return Equal;
	}

	if( !Equal )
		return C1;
	else
		return Equal;
}


